package com.liit.module.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.liit.module.dao.BrandDao;
import com.liit.module.entity.Brand;
import com.liit.module.frame.utils.page.Pagination;
import com.liit.module.service.BrandService;

/**
 * @author dingweibo
 * @Title: BrandServiceImpl.java
 * @Description: 品牌故事服务实现
 * @date 2015年12月18日
 */
@Service("brandService")
public class BrandServiceImpl implements BrandService {

	@Autowired
	BrandDao brandDao;

	@Override
	public Map<String, Object> listPage(Pagination pagination, Brand record) {
		Map<String, Object> result = new HashMap<String, Object>();
		result.put("list", brandDao.listPage(pagination, record));
		result.put("page", pagination);
		return result;
	}

	@Override
	public Brand selectById(Integer id) {
		return brandDao.selectById(id);
	}

	@Override
	public int updateById(Brand record) {
		return brandDao.updateById(record);
	}

	@Override
	public int deleteById(Integer id) {
		return brandDao.deleteById(id);
	}

	@Override
	public int insertAndReturnPK(Brand record) {
		brandDao.insert(record);
		return record.getId();
	}

	@Override
	public List<Brand> listOther(List<Integer> ids) {
		return brandDao.listOther(ids);
	}

	@Override
	public int update(Brand record) {
		return brandDao.update(record);
	}

}
